package com.jjwxc.jwjskandriod.adapter;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.jjwxc.jwjskandriod.fragment.AllSuggestFragment;
import com.jjwxc.jwjskandriod.fragment.DerivativeFragment;

public class SuggestAdapter  extends FragmentPagerAdapter {
    public SuggestAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int i) {
        Fragment fragment = null;
        switch (i) {
            case 0:
                fragment = new AllSuggestFragment();
                break;
            case 1:
                fragment = new DerivativeFragment("1","1");
                break;
            case 2:
                fragment = new DerivativeFragment("2","2");
                break;
            case 3:
                fragment = new DerivativeFragment("3","3");
                break;
            default:
                break;
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return 4;
    }

}
